package com.shop.service.impl;

import java.util.List;

import com.shop.bean.Address;
import com.shop.dao.IAddressDao;
import com.shop.dao.impl.AddressDaoImpl;
import com.shop.service.IAddressService;

/** 
 * @className: AddressServiceImpl.java
 * @classDescription: 
 * @function: 
 * @author: Victor
 * @createTime: 2012-11-1 下午07:18:09
 * @modifyTime: 
 * @modifyReason: 
 * @since: JDK 1.6
 */
public class AddressServiceImpl implements IAddressService{
	private IAddressDao addressDao = null;
	public int createAddress(Address address) throws Exception {
		addressDao = new AddressDaoImpl();
		return this.addressDao.createAddress(address);
	}

	public int deleteAddressById(long addressId) throws Exception {
		return this.addressDao.deleteAddressId(addressId);
	}

	public List<Address> queryAllAddress() throws Exception {
		return this.addressDao.queryAllAddress();
	}

	public Address queryAddressById(long addressId) throws Exception {
		return this.addressDao.queryAddressId(addressId);
	}

	public int updateAddress(Address address) throws Exception {
		return this.addressDao.updateAddress(address);
	}

	public List<Address> queryAllAddress(int startPage, int pageSize)
			throws Exception {
		return this.addressDao.queryAllAddress(startPage, pageSize);
	}
}
